﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Xml;
using System.IO;

namespace HousingDistribution
{
    class DataDictionary
    {
        static public DataDictionary Instance()
        {
            if (instance == null)
                instance = new DataDictionary();

            return instance;
        }

        private static DataDictionary instance = null;

        public void Read(string path)
        {
            try
            {
                XmlDocument reader = new XmlDocument();
                reader.Load(path);
            
                ReadUnit(reader);
                ReadPersonType(reader);
                ReadHousingType(reader);
                ReadArmmanTechRank(reader);
                ReadArmmanTechTitle(reader);
                ReadArmmanGrade(reader);
                ReadArmmanEvaluation(reader);
                ReadStaffAdminDuty(reader);
                ReadStaffTechTitle(reader);
                ReadWorkerTechTitle(reader);
                ReadServiceLength2ArmmanGrade(reader);
                ReadNCOServicelength2ArmmanGrade(reader);
                ReadMaritalStatus(reader);
                ReadExcelSheetName(reader);
                ReadWithArmyStatus(reader);

                ReadPersonTable(reader);
                ReadPersonSortInfoTable(reader);
                ReadHousingTable(reader);
                ReadDGVNewColInfo(reader);

                ReadWorkStatus(reader);
                ReadWorkStatusGroup(reader);

                ReadDGVConf(reader);
                ReadDGVDisplayCtrl(reader);
                ReaddRptTitle(reader);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }

        #region 数据库中 房子的信息
        
        public string[] YardTableInMySql()
        {
            return this.yardTable.Keys.ToArray();
        }

        public string[] BuildingNoTableInMySql(string yardName)
        {
            if (this.yardTable.ContainsKey(yardName))
                return this.yardTable[yardName].Keys.ToArray();
            else
                return null;
        }

        public List<string> DoorwayTableInMySql(string yardName, string buildingNo)
        {
            if (this.yardTable.ContainsKey(yardName) && this.yardTable[yardName].ContainsKey(buildingNo))
                return this.yardTable[yardName][buildingNo];
            else
                return null;
        }

        public List<string> HousingTypeTableInMySql(string yardName)
        {
            if (this.housingTypeTable.ContainsKey(yardName))
                return this.housingTypeTable[yardName];
            else
                return null;
        }

        public void ReadHousingInfoFromMySql()
        {
            try
            {
                ReadHousingInfo();
                ReadHousingTypeTable();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }

        private void ReadHousingTypeTable()
        {
            string sql = "select distinct housingType, streetNo from housing order by streetNo";

            DataTable dt = DBProc.Instance().ReadData(sql).Tables[0];

            string[] yards = YardTableInMySql();
            foreach (string no in yards)
            {
                List<string> table = new List<string>();

                foreach (DataRow dr in dt.Rows)
                {
                    if (dr["streetNo"].ToString() == no)
                    {
                        table.Add(dr["housingType"].ToString());
                    }
                }

                this.housingTypeTable.Add(no, table);
            }
        }

        private void ReadHousingInfo()
        {
            string sql = "select distinct doorWay, buildingNo, streetNo from housing order by streetNo, -buildingNo desc, -doorWay desc";

            DataTable dt = DBProc.Instance().ReadData(sql).Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                string yardName = dr[2].ToString();
                string buildingNo = dr[1].ToString();
                string doorWay = dr[0].ToString();

                //已存在院落的信息，直接存入，否则应该先创建院落
                if (this.yardTable.ContainsKey(yardName) == false)
                {
                    Dictionary<string, List<string>> yardInfo = new Dictionary<string, List<string>>();
                    this.yardTable.Add(yardName, yardInfo);
                }

                Dictionary<string, List<string>> buildingInfo = this.yardTable[yardName];
                //已存在楼的信息，直接存入，否则应该先创建楼表
                if (buildingInfo.ContainsKey(buildingNo) == false)
                {
                    List<string> doorwayTable = new List<string>();
                    buildingInfo.Add(buildingNo, doorwayTable);
                }

                buildingInfo[buildingNo].Add(doorWay);
            }
        }

        //房屋 院落地址与房屋类型对应表
        private Dictionary<string, List<string>> housingTypeTable = new Dictionary<string, List<string>>();

        //院落信息表：根据键值 街道，可以获取院落的信息
        //院落信息由一系列 楼的信息组成
        //楼的信息： 键值，楼号，获得包含楼道的列表
        private Dictionary<string, Dictionary<string, List<string>>> yardTable = new Dictionary<string, Dictionary<string, List<string>>>();
        #endregion

        #region HousingType
        private string[] housingType;
        public string[] HousingType()
        {
            return housingType;
        }

        void ReadHousingType(XmlDocument reader)
        {
            try
            {
                XmlNodeList list = reader.SelectNodes("/elements/HousingType/value");

                this.housingType = new string[list.Count];
                for (int i = 0; i < list.Count; i++)
                {
                    this.housingType[i] = list[i].Attributes["name"].Value;
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("房屋类型数据错误", "XML配置文件数据错误");
            }
        }

        #endregion

        #region PersonType
        //人员类别表
        public string[] PersonType()
        {
            return this.personTypeString2EnumTable.Keys.ToArray();
        }

        public string GetPersonType(PersonTypeEnum type)
        {
            if (personTypeEnum2StringTable.ContainsKey(type))
                return personTypeEnum2StringTable[type];

            return null;
        }

        public PersonTypeEnum GetPersonType(string type)
        {
            if (personTypeString2EnumTable.ContainsKey(type))
                return personTypeString2EnumTable[type];

            return PersonTypeEnum.Unknown;
        }

        private Dictionary<PersonTypeEnum, string> personTypeEnum2StringTable = new Dictionary<PersonTypeEnum, string>();
        private Dictionary<string, PersonTypeEnum> personTypeString2EnumTable = new Dictionary<string, PersonTypeEnum>();

        void ReadPersonType(XmlDocument reader)
        {
            try
            {
                XmlNodeList elemList = reader.SelectNodes("/elements/PersonType/value");

                foreach (XmlElement e in elemList)
                {
                    string typeName = e.Attributes["name"].Value;
                    PersonTypeEnum type = (PersonTypeEnum)Enum.Parse(typeof(PersonTypeEnum), e.Attributes["enum"].Value, true);

                    if (this.personTypeEnum2StringTable.ContainsKey(type))
                        this.personTypeEnum2StringTable.Remove(type);

                    this.personTypeEnum2StringTable.Add(type, typeName);

                    if (this.personTypeString2EnumTable.ContainsKey(typeName))
                        this.personTypeString2EnumTable.Remove(typeName);

                    this.personTypeString2EnumTable.Add(typeName, type);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("人员类型数据错误", "XML配置文件数据错误");
            }
        }

        #endregion

        #region 人员工作状态
        
        //军人，士官其他类型
        public string[] WorkStatusGroup(PersonTypeEnum personType)
        {
            if (workStatusGroup.ContainsKey(personType))
                return workStatusGroup[personType];

            return null;
        }

        public string GetWorkStatus(WorkStatusEnum workStatus)
        {
            if (workStatusEnum2StringTable.ContainsKey(workStatus))
                return workStatusEnum2StringTable[workStatus];

            return null;
        }

        public WorkStatusEnum GetWorkStatus(string workStatus)
        {
            if (workStatusString2EnumTable.ContainsKey(workStatus))
                return workStatusString2EnumTable[workStatus];

            return WorkStatusEnum.Onduty;
        }

        private Dictionary<WorkStatusEnum, string> workStatusEnum2StringTable = new Dictionary<WorkStatusEnum, string>();
        private Dictionary<string, WorkStatusEnum> workStatusString2EnumTable = new Dictionary<string, WorkStatusEnum>();
        void ReadWorkStatus(XmlDocument reader)
        {
            try
            {
                XmlNodeList elemList = reader.SelectNodes("/elements/WorkStatus/value");

                foreach (XmlElement e in elemList)
                {
                    string statusName = e.Attributes["name"].Value;
                    WorkStatusEnum workStatus = (WorkStatusEnum)Enum.Parse(typeof(WorkStatusEnum), e.Attributes["enum"].Value, true);

                    if (this.workStatusEnum2StringTable.ContainsKey(workStatus))
                        this.workStatusEnum2StringTable.Remove(workStatus);

                    this.workStatusEnum2StringTable.Add(workStatus, statusName);

                    if (this.workStatusString2EnumTable.ContainsKey(statusName))
                        this.workStatusString2EnumTable.Remove(statusName);

                    this.workStatusString2EnumTable.Add(statusName, workStatus);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("其他人员类型数据错误", "XML配置文件数据错误");
            }
        }

        private Dictionary<PersonTypeEnum, string[]> workStatusGroup = new Dictionary<PersonTypeEnum,string[]>();
        void ReadWorkStatusGroup(XmlDocument reader)
        {
            try
            {
                PersonTypeEnum[] types = { PersonTypeEnum.ArmMan, PersonTypeEnum.Staff, PersonTypeEnum.Worker, PersonTypeEnum.NCO };

                foreach (PersonTypeEnum type in types)
                {
                    StringBuilder str = new StringBuilder("/elements/WorkStatusGroup/");
                    str.Append(type.ToString());
                    str.Append("/value");

                    XmlNodeList elemList = reader.SelectNodes(str.ToString());

                    if (elemList.Count > 0)
                    {
                        string[] status = new string[elemList.Count];

                        for (int i = 0; i < elemList.Count; i++)
                        {
                            XmlNode e = elemList[i];
                            string statusName = e.Attributes["name"].Value;
                            status[i] = statusName;
                        }
                        this.workStatusGroup.Add(type, status);
                    }
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("其他人员类型数据错误", "XML配置文件数据错误");
            }
        }

        #endregion

        #region WithArmy
        //随军状况映射表
        public string[] WithArmyStatus()
        {
            return this.withArmyString2EnumTable.Keys.ToArray();
        }
        //获得随军权重
        //public int GetWitharmyWeight(WithArmyStatusEnum witharmy)
        //{
        //    if (witharmyWeightTable.ContainsKey(witharmy))
        //        return witharmyWeightTable[witharmy];

        //    return 0;
        //}

        public string GetWitharmyStatus(WithArmyStatusEnum type)
        {
            if (withArmyEnum2StringTable.ContainsKey(type))
                return withArmyEnum2StringTable[type];

            return null;
        }

        public WithArmyStatusEnum GetWitharmy(string type)
        {
            if (withArmyString2EnumTable.ContainsKey(type))
                return withArmyString2EnumTable[type];

            return WithArmyStatusEnum.Unkown;
        }

        private Dictionary<WithArmyStatusEnum, string> withArmyEnum2StringTable = new Dictionary<WithArmyStatusEnum, string>();
        private Dictionary<string, WithArmyStatusEnum> withArmyString2EnumTable = new Dictionary<string, WithArmyStatusEnum>();
        //随军状况权重表
        private Dictionary<WithArmyStatusEnum, int> witharmyWeightTable = new Dictionary<WithArmyStatusEnum, int>();

        void ReadWithArmyStatus(XmlDocument reader)
        {
            try
            {
                XmlNodeList list = reader.SelectNodes("/elements/WithArmyStatus/value");

                foreach (XmlElement e in list)
                {
                    string statusStr = e.Attributes["name"].Value;
                    WithArmyStatusEnum status = (WithArmyStatusEnum)Enum.Parse(typeof(WithArmyStatusEnum), e.Attributes["enum"].Value, true);
                    //int weight = Convert.ToInt16(e.Attributes["weight"].Value);

                    if (this.withArmyEnum2StringTable.ContainsKey(status))
                        this.withArmyEnum2StringTable.Remove(status);

                    this.withArmyEnum2StringTable.Add(status, statusStr);

                    if (this.withArmyString2EnumTable.ContainsKey(statusStr))
                        this.withArmyString2EnumTable.Remove(statusStr);

                    this.withArmyString2EnumTable.Add(statusStr, status);

                    //if (this.witharmyWeightTable.ContainsKey(status))
                    //    this.witharmyWeightTable.Remove(status);

                    //this.witharmyWeightTable.Add(status, weight);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("随军数据错误", "XML配置文件数据错误");
            }
        }

        #endregion

        #region Marital
        //婚姻状态映射表
        public string[] PersonMaritalStatus()
        {
            return this.personMaritalString2EnumTable.Keys.ToArray();
        }

        //获得婚姻权重
        public int GetMaritalWeight(PersonMaritalEnum marital)
        {
            if (maritalWeightTable.ContainsKey(marital))
                return maritalWeightTable[marital];

            return 0;
        }

        ////已婚的、未随军无子女降级。
        //public int GetMaritalWeight(PersonMaritalEnum marital, WithArmyStatusEnum witharmy)
        //{
        //    if (PersonMaritalEnum.Married == marital && WithArmyStatusEnum.NotWithArmyWithoutChild == witharmy)
        //    {
        //        return maritalWeightTable[PersonMaritalEnum.Unmarried];
        //    }
        //    else if (maritalWeightTable.ContainsKey(marital))
        //        return maritalWeightTable[marital];
        //    return 0;
        //}

        public string GetMaritalStatus(PersonMaritalEnum type)
        {
            if (personMaritalEnum2StringTable.ContainsKey(type))
                return personMaritalEnum2StringTable[type];

            return null;
        }

        public PersonMaritalEnum GetMorital(string type)
        {
            if (personMaritalString2EnumTable.ContainsKey(type))
                return personMaritalString2EnumTable[type];

            //return PersonMaritalEnum.Unknown;
            return PersonMaritalEnum.Married;
        }

        private Dictionary<PersonMaritalEnum, string> personMaritalEnum2StringTable = new Dictionary<PersonMaritalEnum, string>();
        private Dictionary<string, PersonMaritalEnum> personMaritalString2EnumTable = new Dictionary<string, PersonMaritalEnum>();
        //婚姻状况权重表
        private Dictionary<PersonMaritalEnum, int> maritalWeightTable = new Dictionary<PersonMaritalEnum, int>();

        void ReadMaritalStatus(XmlDocument reader)
        {
            try
            {
                XmlNodeList list = reader.SelectNodes("/elements/MaritalStatus/value");

                foreach (XmlElement e in list)
                {
                    string statusStr = e.Attributes["name"].Value;
                    PersonMaritalEnum status = (PersonMaritalEnum)Enum.Parse(typeof(PersonMaritalEnum), e.Attributes["enum"].Value, true);
                    int weight = Convert.ToInt16(e.Attributes["weight"].Value);

                    if (this.personMaritalEnum2StringTable.ContainsKey(status))
                        this.personMaritalEnum2StringTable.Remove(status);

                    this.personMaritalEnum2StringTable.Add(status, statusStr);

                    if (this.personMaritalString2EnumTable.ContainsKey(statusStr))
                        this.personMaritalString2EnumTable.Remove(statusStr);

                    this.personMaritalString2EnumTable.Add(statusStr, status);

                    if (this.maritalWeightTable.ContainsKey(status))
                        this.maritalWeightTable.Remove(status);

                    this.maritalWeightTable.Add(status, weight);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("婚姻数据错误", "XML配置文件数据错误");
            }
        }

        #endregion

        #region Unit
        public string[] Unit()
        {
            return unitWeightTable.Keys.ToArray();
        }
        //获得单位权重
        public int GetUnitWeight(string unit)
        {
            if (unitWeightTable.ContainsKey(unit))
                return unitWeightTable[unit];

            return 0;
        }

        //单位权重表
        private Dictionary<string, int> unitWeightTable = new Dictionary<string, int>();

        void ReadUnit(XmlDocument reader)
        {
            try
            {
                XmlNodeList elemList = reader.SelectNodes("/elements/Unit/value");

                foreach (XmlElement e in elemList)
                {
                    string unit = e.Attributes["name"].Value;
                    int weight = 0;
                    if (e.Attributes["weight"] != null)
                        weight = Convert.ToInt16(e.Attributes["weight"].Value);

                    if (this.unitWeightTable.ContainsKey(unit))
                        this.unitWeightTable.Remove(unit);

                    this.unitWeightTable.Add(unit, weight);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("单位数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #region Armman
        #region ArmmanTechRank
        private string[] armmanTechRank;
        public string[] ArmmanTechRank()
        {
            return armmanTechRank;
        }

        void ReadArmmanTechRank(XmlDocument reader)
        {
            try
            {
                XmlNodeList list = reader.SelectNodes("/elements/ArmmanTechRank/value");
                this.armmanTechRank = new string[list.Count];

                for (int i = 0; i < list.Count; i++)
                {
                    armmanTechRank[i] = list[i].Attributes["name"].Value;
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("军人技术级别数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #region ArmmanGrade
        public string[] Grade()
        {
            return grade2weightTable.Keys.ToArray();
        }

        //通过级别获取统一的级别权重（方面比较、排序）
        public int GetGradeWeight(string grade)
        {
            if (grade == null)
                return 0;

            if (grade2weightTable.ContainsKey(grade))
                return grade2weightTable[grade];

            return 0;
        }
        
        //报表时未婚，离异无子女，未随军无子女的分下一职级房子，师-团，团-营。
        public string GetLowerGrade(string sortGrade)
        {
            if (sortGrade == null || sortGrade == "")
                return null;
            else if (sortGrade.Contains("军"))
                return "";
            else if (sortGrade.Contains("师"))
                return ",分团职住房";
            else if (sortGrade.Contains("团"))
                return ",分营职住房";
            else if (sortGrade.Contains("营"))
                return ",分营职以下住房";

            return null;
        }

        //public int GetGradeDownValue(PersonMaritalEnum marital, string grade)
        //{
        //    if (marital == PersonMaritalEnum.Unmarried || marital == PersonMaritalEnum.DivorcedWithoutChild)
        //    {
        //        if (divorceWithoutChild2GradeDownValueTable.ContainsKey(grade))
        //            return divorceWithoutChild2GradeDownValueTable[grade];
        //    }
        //    else
        //    {
        //        if (divoiceWithChild2GradeDownValueTable.ContainsKey(grade))
        //            return divoiceWithChild2GradeDownValueTable[grade];
        //    }

        //    return 0;
        //}

        
        public int GetGradeDownValue(PersonMaritalEnum marital, string grade, WithArmyStatusEnum witharmy)
        {
            //已婚的、未随军无子女的降级。未婚，离异无子女降级。
            if ((PersonMaritalEnum.Married == marital && WithArmyStatusEnum.NotWithArmyWithoutChild == witharmy) 
                || marital == PersonMaritalEnum.Unmarried || marital == PersonMaritalEnum.DivorcedWithoutChild)
            {
                if (divorceWithoutChild2GradeDownValueTable.ContainsKey(grade))
                    return divorceWithoutChild2GradeDownValueTable[grade];
            }
            else
            {
                if (divoiceWithChild2GradeDownValueTable.ContainsKey(grade))
                    return divoiceWithChild2GradeDownValueTable[grade];
            }

            return 0;
        }

        public int GetSpaceStandard(string grade)
        {
            if (this.spaceStandardTable.ContainsKey(grade))
                return this.spaceStandardTable[grade];

            return 0;
        }
        //级别权重表
        private Dictionary<string, int> grade2weightTable = new Dictionary<string, int>();

        //婚姻状况降级表: 通过降级分数的不同，实现有子女的优先于无子女的
        //1. 未婚和离异无子女，排队时降一级，师-团，团-营，营以下无分房资格。
        Dictionary<string, int> divorceWithoutChild2GradeDownValueTable = new Dictionary<string, int>();
        //2. 离异有子女，排队时降一级，师-团，团-营，营-营以下。
        Dictionary<string, int> divoiceWithChild2GradeDownValueTable = new Dictionary<string, int>();

        //住房标准表
        Dictionary<string, int> spaceStandardTable = new Dictionary<string, int>();

        private void ReadArmmanGrade(XmlDocument reader)
        {
            try
            {
                XmlNodeList list = reader.SelectNodes("/elements/ArmmanGrade/value");
                for (int i = 0; i < list.Count; i++)
                {
                    string grade = list[i].Attributes["name"].Value;
                    int weight = Convert.ToInt16(list[i].Attributes["weight"].Value);

                    int divorceWithChildDownWeight = 0;
                    if (list[i].Attributes["DivorceWithChildDownWeight"] != null)
                        divorceWithChildDownWeight = Convert.ToInt16(list[i].Attributes["DivorceWithChildDownWeight"].Value);

                    int divorceWithoutChildDownWeight = 0;
                    if (list[i].Attributes["DivorceWithoutChildDownWeight"] != null)
                        divorceWithoutChildDownWeight = Convert.ToInt16(list[i].Attributes["DivorceWithoutChildDownWeight"].Value);

                    if (this.grade2weightTable.ContainsKey(grade))
                        this.grade2weightTable.Remove(grade);

                    this.grade2weightTable.Add(grade, weight);

                    if (this.divoiceWithChild2GradeDownValueTable.ContainsKey(grade))
                        this.divoiceWithChild2GradeDownValueTable.Remove(grade);
                    this.divoiceWithChild2GradeDownValueTable.Add(grade, divorceWithChildDownWeight);

                    if (this.divorceWithoutChild2GradeDownValueTable.ContainsKey(grade))
                        this.divorceWithoutChild2GradeDownValueTable.Remove(grade);
                    this.divorceWithoutChild2GradeDownValueTable.Add(grade, divorceWithoutChildDownWeight);

                    if (this.spaceStandardTable.ContainsKey(grade))
                        this.spaceStandardTable.Remove(grade);

                    if (list[i].Attributes["SpaceStandard"] != null)
                        this.spaceStandardTable.Add(grade, Convert.ToInt16(list[i].Attributes["SpaceStandard"].Value));
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("军人等级数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #region ArmmanTechTitle
        public string[] ArmmanHighTechTitle()
        {
            return this.armmanHighTechTitle;
        }

        public string[] ArmmanMidTechTitle()
        {
            return this.armmanMidTechTitle;
        }

        private string[] armmanHighTechTitle;
        private string[] armmanMidTechTitle;

        private void ReadArmmanTechTitle(XmlDocument reader)
        {
            try
            {
                int i = 0;

                XmlNodeList list = reader.SelectNodes("/elements/ArmmanTechTitle/high/value");

                this.armmanHighTechTitle = new string[list.Count];
                for (i = 0; i < list.Count; i++)
                {
                    this.armmanHighTechTitle[i] = list[i].Attributes["name"].Value;
                }

                list = reader.SelectNodes("/elements/ArmmanTechTitle/mid/value");

                this.armmanMidTechTitle = new string[list.Count];
                for (i = 0; i < list.Count; i++)
                {
                    this.armmanMidTechTitle[i] = list[i].Attributes["name"].Value;
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("军人技术职称数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #region ArmmanEvaluation
        //evaluation
        public string[] PersonEvaluation()
        {
            return this.evaluationWeightTable.Keys.ToArray();
        }

        //通过evaluation获取对应权重
        public int GetEvaluationWeight(string evaluation)
        {
            if (evaluation == null)
                return 0;

            if (evaluationWeightTable.ContainsKey(evaluation))
                return evaluationWeightTable[evaluation];

            return 0;
        }

        //特殊人群权重表
        private Dictionary<string, int> evaluationWeightTable = new Dictionary<string, int>();
        void ReadArmmanEvaluation(XmlDocument reader)
        {
            try
            {
                XmlNodeList list = reader.SelectNodes("/elements/ArmmanEvaluation/value");

                foreach (XmlElement e in list)
                {
                    string evaluation = e.Attributes["name"].Value;
                    int weight = Convert.ToInt16(e.Attributes["weight"].Value);

                    if (this.evaluationWeightTable.ContainsKey(evaluation))
                        this.evaluationWeightTable.Remove(evaluation);

                    this.evaluationWeightTable.Add(evaluation, weight);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("军人特殊人群数据错误", "XML配置文件数据错误");
            }
        }
        #endregion
        #endregion

        #region Worker
        #region WorkerTechTitle
        public string[] WorkerTechtitle()
        {
            return workerTechTitle2ArmmanGradeTable.Keys.ToArray();
        }

        //工人技术职称对应军人等级的对照表(目前工人的技术职称还未和军人的等级建立映射，这里做一个预留实现设计)
        Dictionary<string, string> workerTechTitle2ArmmanGradeTable = new Dictionary<string, string>();
        private void ReadWorkerTechTitle(XmlDocument reader)
        {
            try
            {
                XmlNodeList list = reader.SelectNodes("/elements/WorkerTechTitle/value");

                for (int i = 0; i < list.Count; i++)
                {
                    string title = list[i].Attributes["name"].Value;
                    string armmanGrade = null;
                    if (list[i].Attributes["ArmmanGrade"] != null)
                        armmanGrade = list[i].Attributes["ArmmanGrade"].Value;

                    this.workerTechTitle2ArmmanGradeTable.Add(title, armmanGrade);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("工人技术职称数据错误", "XML配置文件数据错误");
            }
        }
        #endregion
        #endregion

        #region Staff

        #region StaffGrade
        public string[] StaffGrade()
        {
            return this.staffAdminDuty2ArmmanGradeTable.Keys.ToArray();
        }
        
        public string GetStaffGrade(PersonInfo personinfo)
        {
            string grade = null;
            int gradeWeight = 0;

            string grade1 = null;
            if (staffAdminDuty2ArmmanGradeTable.ContainsKey(personinfo.adminDuty))
                grade1 = staffAdminDuty2ArmmanGradeTable[personinfo.adminDuty];
            int gradeWeight1 = GetGradeWeight(grade1);

            string grade2 = null;
            if (staffTechTitle2ArmmanGradeTable.ContainsKey(personinfo.techTitle))
                grade2 = staffTechTitle2ArmmanGradeTable[personinfo.techTitle];
            int gradeWeight2 = GetGradeWeight(grade2);

            if (gradeWeight1 < gradeWeight2)
            {
                grade = grade2;
                gradeWeight = gradeWeight2;
            }
            else
            {
                grade = grade1;
                gradeWeight = gradeWeight1;
            }

            string grade3 = GetGradeByServiceLen(ServiceLengthCount.Instance().ServiceLength(personinfo));
            int gradeWeight3 = GetGradeWeight(grade3);

            if (gradeWeight < gradeWeight3)
            {
                grade = grade3;
                gradeWeight = gradeWeight3;
            }

            return grade;
        }

        //职员管理职务对应军人级别，方便无配偶时降级处理
        Dictionary<string, string> staffAdminDuty2ArmmanGradeTable = new Dictionary<string, string>();
        void ReadStaffAdminDuty(XmlDocument reader)
        {
            try
            {
                XmlNodeList elemList = reader.SelectNodes("/elements/StaffAdminDuty/value");

                foreach (XmlElement e in elemList)
                {
                    string adminDuty = e.Attributes["name"].Value;
                    string armmanGrade = e.Attributes["ArmmanGrade"].Value;

                    if (this.staffAdminDuty2ArmmanGradeTable.ContainsKey(adminDuty))
                        this.staffAdminDuty2ArmmanGradeTable.Remove(adminDuty);

                    this.staffAdminDuty2ArmmanGradeTable.Add(adminDuty, armmanGrade);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("职员管理职务数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #region StaffTechTitle
        public string[] StaffTechtitle()
        {
            return this.staffTechTitle2ArmmanGradeTable.Keys.ToArray();
        }
        //职员技术职称对应军人等级的对照表
        Dictionary<string, string> staffTechTitle2ArmmanGradeTable = new Dictionary<string, string>();
        private void ReadStaffTechTitle(XmlDocument reader)
        {
            try
            {
                XmlNodeList list = reader.SelectNodes("/elements/StaffTechTitle/value");
                for (int i = 0; i < list.Count; i++)
                {
                    string title = list[i].Attributes["name"].Value;
                    string armmanGrade = list[i].Attributes["ArmmanGrade"].Value;

                    if (this.staffTechTitle2ArmmanGradeTable.ContainsKey(title))
                        this.staffTechTitle2ArmmanGradeTable.Remove(title);

                    this.staffTechTitle2ArmmanGradeTable.Add(title, armmanGrade);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("职员技术职称数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #endregion

        #region 现级副职时间中缺失
        public string RankInfoForCurRankBeforeTimeMissing()
        {
            return this.rankInfoForCurRankBeforeTimeMising;
        }
        //excel中现级副职时间中缺失时，需根据相关职别进行处理
        private readonly string rankInfoForCurRankBeforeTimeMising = "技10#技11#技12#技13#营#连";
        #endregion

        #region Excel的sheet对应的数据表名称
        public string GetDataTypeBySheetName(string sheetName)
        {
            if (excelSheetTable.ContainsKey(sheetName))
                return excelSheetTable[sheetName].ToString();

            return null;
        }

        private Dictionary<string, PersonTypeEnum> excelSheetTable = new Dictionary<string, PersonTypeEnum>();

        void ReadExcelSheetName(XmlDocument reader)
        {
            try
            {
                XmlNodeList elemList = reader.SelectNodes("/elements/ExcelSheet/value");

                foreach (XmlElement e in elemList)
                {
                    string sheetName = e.Attributes["name"].Value;
                    PersonTypeEnum type = (PersonTypeEnum)Enum.Parse(typeof(PersonTypeEnum), e.Attributes["enum"].Value, true);

                    if (this.excelSheetTable.ContainsKey(sheetName))
                        this.excelSheetTable.Remove(sheetName);

                    this.excelSheetTable.Add(sheetName, type);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("Excel表单名称数据错误", "XML配置文件数据错误");
            }

        }
        #endregion

        #region 工龄对应军人级别

        //工人、职员工龄对应军人级别
        public string GetGradeByServiceLen(int serviceLength)
        {
            foreach (KeyValuePair<int, int> key in this.serviceLength2ArmmanGrade.Keys)
            {
                if (serviceLength >= key.Key && serviceLength <= key.Value)
                    return this.serviceLength2ArmmanGrade[key];
            }

            return null;
        }

        private Dictionary<KeyValuePair<int, int>, string> serviceLength2ArmmanGrade = new Dictionary<KeyValuePair<int, int>, string>();
        void ReadServiceLength2ArmmanGrade(XmlDocument reader)
        {
            try
            {
                XmlNodeList elemList = reader.SelectNodes("/elements/ServiceLength2ArmmanGrade/value");

                foreach (XmlElement e in elemList)
                {
                    int min = Convert.ToInt16(e.Attributes["min"].Value);
                    int max = Convert.ToInt16(e.Attributes["max"].Value);
                    string armmanGrade = e.Attributes["ArmmanGrade"].Value;

                    KeyValuePair<int, int> value = new KeyValuePair<int, int>(Math.Min(min, max), Math.Max(min, max));
                    if (this.serviceLength2ArmmanGrade.ContainsKey(value))
                        this.serviceLength2ArmmanGrade.Remove(value);

                    this.serviceLength2ArmmanGrade.Add(value, armmanGrade);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("工龄数据错误", "XML配置文件数据错误");
            }
        }

        //高级士官军龄对应军人级别
        public string NCOGetGradeByServiceLen(int serviceLength)
        {
            foreach (KeyValuePair<int, int> key in this.ncoServicelength2ArmmanGrade.Keys)
            {
                if (serviceLength >= key.Key && serviceLength <= key.Value)
                    return this.ncoServicelength2ArmmanGrade[key];
            }
            return null;
        }

        private Dictionary<KeyValuePair<int, int>, string> ncoServicelength2ArmmanGrade = new Dictionary<KeyValuePair<int, int>, string>();
        void ReadNCOServicelength2ArmmanGrade(XmlDocument reader)
        {
            try
            {
                XmlNodeList elemList = reader.SelectNodes("/elements/NCOServiceLength2ArmmanGrade/value");
                foreach (XmlElement e in elemList)
                {
                    int min = Convert.ToInt16(e.Attributes["min"].Value);
                    int max = Convert.ToInt16(e.Attributes["max"].Value);
                    string armmanGrade = e.Attributes["ArmmanGrade"].Value;

                    KeyValuePair<int, int> value = new KeyValuePair<int, int>(Math.Min(min, max), Math.Max(min, max));
                    if (this.ncoServicelength2ArmmanGrade.ContainsKey(value))
                        this.ncoServicelength2ArmmanGrade.Remove(value);

                    this.ncoServicelength2ArmmanGrade.Add(value, armmanGrade);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("士官工龄数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #region 数据无效字符
        public static string[] InvalidChrTable = { @"\", " " };
        #endregion

        #region 数据库字段

        #region Person
        public string[] PersonTableNames()
        {
            return this.personTableFieldName.Keys.ToArray();
        }

        public string PersonTableFieldName(string name)
        {
            if (this.personTableFieldName.ContainsKey(name))
                return this.personTableFieldName[name];

            return null;
        }

        private Dictionary<string, string> personTableFieldName = new Dictionary<string, string>();

        void ReadPersonTable(XmlDocument reader)
        {
            try
            {
                XmlNodeList elemList = reader.SelectNodes("/elements/DB/Person/value");

                foreach (XmlElement e in elemList)
                {
                    string name = e.Attributes["name"].Value;
                    string field = e.Attributes["field"].Value;

                    if (this.personTableFieldName.ContainsKey(name))
                        this.personTableFieldName.Remove(name);

                    this.personTableFieldName.Add(name, field);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("人员数据库表信息数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #region PersonSortInfo
        public string PersonSortInfoTableFieldName(string name)
        {
            if (this.personSortInfoTableFieldName.ContainsKey(name))
                return this.personSortInfoTableFieldName[name];

            return null;
        }

        private Dictionary<string, string> personSortInfoTableFieldName = new Dictionary<string, string>();

        void ReadPersonSortInfoTable(XmlDocument reader)
        {
            try
            {
                XmlNodeList elemList = reader.SelectNodes("/elements/DB/PersonSortInfo/value");

                foreach (XmlElement e in elemList)
                {
                    string name = e.Attributes["name"].Value;
                    string field = e.Attributes["field"].Value;

                    if (this.personSortInfoTableFieldName.ContainsKey(name))
                        this.personSortInfoTableFieldName.Remove(name);

                    this.personSortInfoTableFieldName.Add(name, field);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("人员排序信息数据库表信息数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #region Housing
        public string HousingTableFieldName(string name)
        {
            if (this.housingTableFieldName.ContainsKey(name))
                return this.housingTableFieldName[name];

            return null;
        }

        private Dictionary<string, string> housingTableFieldName = new Dictionary<string, string>();

        void ReadHousingTable(XmlDocument reader)
        {
            try
            {
                XmlNodeList elemList = reader.SelectNodes("/elements/DB/Housing/value");

                foreach (XmlElement e in elemList)
                {
                    string name = e.Attributes["name"].Value;
                    string field = e.Attributes["field"].Value;

                    if (this.housingTableFieldName.ContainsKey(name))
                        this.housingTableFieldName.Remove(name);

                    this.housingTableFieldName.Add(name, field);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("房屋数据库表信息数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #endregion

        #region DGV 新的显示字段（数据库中不存在）

        public string DGVNewColName(string name)
        {
            if (this.dgvNewColFieldName.ContainsKey(name))
                return this.dgvNewColFieldName[name];

            return null;
        }

        private Dictionary<string, string> dgvNewColFieldName = new Dictionary<string, string>();

        void ReadDGVNewColInfo(XmlDocument reader)
        {
            try
            {
                XmlNodeList elemList = reader.SelectNodes("/elements/DGVNewCol/value");

                foreach (XmlElement e in elemList)
                {
                    string name = e.Attributes["name"].Value;
                    string field = e.Attributes["field"].Value;

                    if (this.dgvNewColFieldName.ContainsKey(name))
                        this.dgvNewColFieldName.Remove(name);

                    this.dgvNewColFieldName.Add(name, field);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("DGV 新增列信息数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #region DataGridView 初始化
        public struct DGVConf
        {
            public string name;
            public string title;
            public string type;
            public bool visible;
            public bool readOnly;
            public int width;
        }

        public DGVConf[] GetDGVConf(string dgvName)
        {
            if (this.dgvConfs.ContainsKey(dgvName))
                return this.dgvConfs[dgvName];

            return null;
        }

        public string[] dgvNames = { "FormHousingDis.dataGridView", "FormPersonSearch.dataGridViewPersonSearch", 
                                       "FormHousingSelect.dataGridViewSelectHousing", "FormPersonDetailsNoHousingTab.dataGridViewCurHousing", 
                                       "FormFormerHouse.dataGridViewFormerHousing" };

        Dictionary<string, DGVConf[]> dgvConfs = new Dictionary<string, DGVConf[]>();

        void ReadDGVConf(XmlDocument reader)
        {
            try
            {
                foreach (string dgvName in this.dgvNames)
                {
                    StringBuilder str = new StringBuilder("/elements/DataGridViewInit/");
                    str.Append(dgvName);
                    str.Append("/value");

                    XmlNodeList list = reader.SelectNodes(str.ToString());

                    DGVConf[] confs = new DGVConf[list.Count];

                    for (int i = 0; i < list.Count; i++)
                    {
                        XmlNode e = list[i];

                        DGVConf conf;
                        conf.name = e.Attributes["name"].Value;
                        conf.title = e.Attributes["title"].Value;
                        conf.type = null;
                        if (e.Attributes["type"] != null)
                            conf.type = e.Attributes["type"].Value;

                        conf.visible = true;
                        if (e.Attributes["visible"] != null)
                        {
                            if (e.Attributes["visible"].Value == "true")
                                conf.visible = true;
                            else
                                conf.visible = false;
                        }

                        conf.readOnly = true;
                        if (e.Attributes["readonly"] != null)
                        {
                            if (e.Attributes["readonly"].Value == "true")
                                conf.readOnly = true;
                            else
                                conf.readOnly = false;
                        }

                        conf.width = 0;

                        if (e.Attributes["width"] != null)
                        {
                            conf.width = Convert.ToInt16(e.Attributes["width"].Value);
                        }

                        confs[i] = conf;
                    }

                    this.dgvConfs.Add(dgvName, confs);
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("DataGridView初始化数据错误", "XML配置文件数据错误");
            }
        }
        #endregion

        #region FormHousingDis.dataGridView 显示控制(分房处理前后显示不同)

        //未分房处理排序前
        public string[] FormHousingDisDGVUnsortedDisplayedCols(PersonTypeEnum type)
        {
            if (this.DGVUnSortedTitleTable.ContainsKey(type))
                return this.DGVUnSortedTitleTable[type];

            return null;
        }

        //分房处理排序后
        public string[] FormHousingDisDGVSortedDisplayedCols(PersonTypeEnum type)
        {
            if (this.DGVSortedTitleTable.ContainsKey(type))
                return this.DGVSortedTitleTable[type];

            return null;
        }

        //获取列宽（默认最少宽度3）
        public double GetRptColWidth(PersonTypeEnum type, string title)
        {
            if (title == null)
                return 3;

            if (this.ReportColWidthTable.ContainsKey(type))
            {
                if (this.ReportColWidthTable[type].ContainsKey(title))
                {
                    return this.ReportColWidthTable[type][title];
                }
            }

            return 3;
        }

        //分房处理排序前的Title Table
        Dictionary<PersonTypeEnum, string[]> DGVUnSortedTitleTable = new Dictionary<PersonTypeEnum, string[]>();
        //分房处理排序后的Title Table
        Dictionary<PersonTypeEnum, string[]> DGVSortedTitleTable = new Dictionary<PersonTypeEnum, string[]>();

        //报表列宽
        Dictionary<PersonTypeEnum, Dictionary<string, double>> ReportColWidthTable = new Dictionary<PersonTypeEnum, Dictionary<string, double>>();

        void ReadDGVDisplayCtrl(XmlDocument reader)
        {
            try
            {
                PersonTypeEnum[] personType = { PersonTypeEnum.ArmMan, PersonTypeEnum.Staff, PersonTypeEnum.Worker, PersonTypeEnum.NCO };
                string[] sortCtrl = { "Sorted", "Unsorted" };

                foreach (PersonTypeEnum type in personType)
                {
                    Dictionary<string, double> colWidthTable = new Dictionary<string, double>();
                    ReportColWidthTable.Add(type, colWidthTable);

                    foreach (string sort in sortCtrl)
                    {
                        StringBuilder str = new StringBuilder("/elements/DataGridViewDisplayCtrl/FormHousingDis.dataGridView/");
                        str.Append(type.ToString());
                        str.Append("/");
                        str.Append(sort);
                        str.Append("/value");

                        XmlNodeList list = reader.SelectNodes(str.ToString());
                        string[] cols = new string[list.Count];
                        
                        for (int i = 0; i < list.Count; i++)
                        {
                            cols[i] = list[i].Attributes["name"].Value;

                            if (sort == "Sorted")
                            {
                                double width = 3;

                                if (list[i].Attributes["width"] != null)
                                    width = Convert.ToDouble(list[i].Attributes["width"].Value);

                                ReportColWidthTable[type].Add(list[i].Attributes["name"].Value, width);
                            }
                        }

                        if (sort == "Sorted")
                        {
                            this.DGVSortedTitleTable.Add(type, cols);
                        }
                        else
                        {
                            this.DGVUnSortedTitleTable.Add(type, cols);
                        }
                    }
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("FormHousingDis.dataGridView 显示控制数据错误", "XML配置文件数据错误");
            }
        }

        #endregion

        #region 报表表头

        public string GetRptTitle(PersonTypeEnum type, ArmmanGradeEnum grade)
        {
            try
            {
                if (type == PersonTypeEnum.ArmMan)
                {
                    return this.RptTitleTable[type][grade.ToString()];
                }
                else
                {
                    return this.RptTitleTable[type][type.ToString()];
                }
            }
            catch (Exception)
            {
            }
            return null;
        }

        Dictionary<PersonTypeEnum, Dictionary<string, string>> RptTitleTable = new Dictionary<PersonTypeEnum, Dictionary<string, string>>();

        void ReaddRptTitle(XmlDocument reader)
        {
            try
            {
                PersonTypeEnum[] personType = { PersonTypeEnum.ArmMan, PersonTypeEnum.Staff, PersonTypeEnum.Worker, PersonTypeEnum.NCO };

                foreach (PersonTypeEnum type in personType)
                {
                    Dictionary<string, string> titleTable = new Dictionary<string, string>();
                    RptTitleTable.Add(type, titleTable);

                    StringBuilder str = new StringBuilder("/elements/ReporTitle/");
                    str.Append(type.ToString());
                    str.Append("/value");

                    XmlNodeList list = reader.SelectNodes(str.ToString());

                    for (int i = 0; i < list.Count; i++)
                    {
                        string grade = list[i].Attributes["grade"].Value;
                        string title = list[i].Attributes["title"].Value;

                        if (this.RptTitleTable[type].ContainsKey(grade) == false)
                        {
                            this.RptTitleTable[type].Add(grade, title);
                        }
                    }
                }
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("报表表头数据错误", "XML配置文件数据错误");
            }
        }

        #endregion
    }

    #region 数据库、数据表名、DataGridView列名常量

    //数据库字段常量定义
    static class PersonColConsts
    {
        public static string ID = "ID";
        public static string NAME = "NAME";
        public static string TYPE = "TYPE";
        public static string SEX = "SEX";
        public static string UNIT = "UNIT";
        public static string ADMIN_DUTY = "ADMIN_DUTY";
        public static string ADMIN_DUTY_TIME = "ADMIN_DUTY_TIME";
        public static string TECH_RANK = "TECH_RANK";
        public static string TECH_RANK_TIME = "TECH_RANK_TIME";
        public static string TECH_TITLE = "TECH_TITLE";
        public static string TECH_TITLE_TIME = "TECH_TITLE_TIME";
        public static string CUR_RANK_BEFORE_TIME = "CUR_RANK_BEFORE_TIME";
        public static string WORK_TIME = "WORK_TIME";
        public static string SCHOOL_TIME = "SCHOOL_TIME";
        public static string SIGNUP_TIME = "SIGNUP_TIME";
        public static string SERVICE_LENGTH = "SERVICE_LENGTH";
        public static string RETIREMENT_TIME = "RETIREMENT_TIME";
        public static string MARITAL = "MARITAL";
        public static string MATE_NAME = "MATE_NAME";
        public static string MATE_UNIT = "MATE_UNIT";
        public static string MATE_RANK = "MATE_RANK";
        public static string REMARKS = "REMARKS";
        public static string HOUSING_ELIGIBLE = "HOUSING_ELIGIBLE";
        public static string BOTH_EMPLOYEE = "BOTH_EMPLOYEE";
        public static string EVALUATION = "EVALUATION";
        public static string HOUSE_ADDR = "HOUSE_ADDR";
        public static string HOUSE_AREA = "HOUSE_AREA";
        public static string HOUSING_INFO = "HOUSING_INFO";
        public static string FORMER_HOUSING_ID = "FORMER_HOUSING_ID";
        public static string NAME_INITIAL = "NAME_INITIAL";
        public static string WORK_STATUS = "WORK_STATUS";
        public static string WITHARMY = "WITHARMY";
    }

    //分房信息DataTable的Column名称常量定义
    static class PersonSortInfoColConsts
    {
        public static string ID_PERSON = "ID_PERSON";
        public static string GRADE = "GRADE";
        public static string GRADE_TIME = "GRADE_TIME";
        public static string GRADE_WEIGHT = "GRADE_WEIGHT";
        public static string CUR_GRADE_BEFORE_TIME = "CUR_GRADE_BEFORE_TIME";
        public static string WORK_TIME = "WORK_TIME";
        public static string SIGNUP_TIME = "SIGNUP_TIME";
        public static string MATE_NAME = "MATE_NAME";
        public static string EVALUATION_WEIGHT = "EVALUATION_WEIGHT";
        public static string UNIT_WEIGHT = "UNIT_WEIGHT";
    }

    static public class HousingColConsts
    {
        public static string ID = "ID";
        public static string TYPE = "TYPE";
        public static string FULL_ADDR = "FULL_ADDR";
        public static string STREET_NO = "STREET_NO";
        public static string BUILDING_NO = "BUILDING_NO";
        public static string DOORWAY = "DOORWAY";
        public static string FLOOR = "FLOOR";
        public static string ROOM_NO = "ROOM_NO";
        public static string AREA = "AREA";
        public static string HOUSING_USE = "HOUSING_USE";
        public static string HOUSING_PROPERTY = "HOUSING_PROPERTY";
        public static string REMARKS = "REMARKS";
    }

    //DGV表头名称常量（不在数据库内，为了特殊显示效果而增加）
    static public class DGVNewColConsts
    {
        public static string No = "No";
        public static string DRAWING = "DRAWING";
        public static string BOTH_EMPLOYEE = "BOTH_EMPLOYEE";
        public static string HOUSE_AREA = "HOUSE_AREA";
        public static string HOUSE_TYPE = "HOUSE_TYPE";
        public static string SELECT = "SELECT";
        public static string CHECKINTIME = "CHECKINTIME";
        public static string PERSON_TYPE_NAME = "PERSON_TYPE_NAME";
    }

    #endregion

}
